package com.kly.chatter.api.application.controller.im.req;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.enums.RestCodeEnum;
import com.kly.sc.api.infras.exception.ApplicationException;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotEmpty;

/**
 * 只有一个用户内码：userCode 参数的请求类
 * @author linqu
 */
public class ModelUserProfileRequest extends ParamsObject {

    /**
     * 用户内码
     */
    private String userCode;

    private String modelUserCode;

    public String getModelUserCode() {
        return modelUserCode;
    }

    public void setModelUserCode(String modelUserCode) {
        this.modelUserCode = modelUserCode;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    @Override
    public void validate() {
        if (StringUtils.isBlank(this.userCode)) {
            throw new ApplicationException(RestCodeEnum.USERID_NOT_EXIST_ERROR);
        }
        if (StringUtils.isBlank(this.modelUserCode)) {
            throw new ApplicationException(RestCodeEnum.USERID_NOT_EXIST_ERROR);
        }

    }
}
